package org.zoomdev.zoom.dao;

import org.zoomdev.zoom.dao.adapters.EntityField;
import org.zoomdev.zoom.dao.struct.JoinMeta;

import java.sql.ResultSet;

/**
 * @param <T>
 */
public interface Entity<T> {

    int getTableCount();

    /**
     * 关联
     *
     * @return
     */
    JoinMeta[] getJoinMetas();


    EntityField tryToFind(String key);

    Object fromResultSet(ResultSet rs, EntityField[] entityFields);

    int[] generateKeys();

    void parseGenerateKeys(ResultSet rs);

    String getTableName();

    EntityField[] getEntityFields();

    EntityField[] getPrimaryKeys();

    T newInstance();


    Entity addTable(String table);
}
